package user

import (
	"time"
	"wzgames/internal/model/mcomm"
)

// user.sql

type UserEntity struct {
	Uid     uint64       `db:"uid" json:"uid"`
	Uname   string       `db:"uname" json:"uname"`
	AgtId   int64        `db:"agtid" json:"agtid"`
	Agtuid  string       `db:"agtuid" json:"agtuid"`
	Status  mcomm.Status `db:"status" json:"status"`
	Uhead   string       `db:"uhead" json:"uhead"`
	Created time.Time    `db:"created" json:"created"`
	Updated time.Time    `db:"updated" json:"updated"`
	IsRobot uint8        `db:"is_robot" json:"is_robot"`
}

type UserHashEntity struct {
	UHash string `db:"uhash"`
	Uid   uint64 `db:"uid"`
	AgtId int64  `db:"agtid"`
}

type UserLatestEntity struct {
	Uid     uint64    `db:"uid"`
	AgtId   int64     `db:"agtid"`
	InstId  int64     `db:"instid"`
	CurrId  int32     `db:"currid"`
	GameId  int32     `db:"gameid"`
	Uip     []byte    `db:"uip"`
	Created time.Time `db:"created"`
	Updated time.Time `db:"updated"`
}

type UserLoginEntity struct {
	Id       uint64    `db:"id"`
	Uid      uint64    `db:"uid"`
	NodeId   int64     `db:"nodeid"`
	Ip       []byte    `db:"ip"`
	Dateline time.Time `db:"dateline"`
	Uname    string    `db:"uname"`
	AgtId    int64     `db:"agtid"`
	Agtuid   string    `db:"agtuid"`
}

type UserGameLoginEntity struct {
	Id         uint64    `db:"id"`
	Uid        uint64    `db:"uid"`
	InstId     int64     `db:"instid"`
	NodeId     int64     `db:"nodeid"`
	CurrId     int32     `db:"currid"`
	GameId     int32     `db:"gameid"`
	Ip         []byte    `db:"ip"`
	Dateline   time.Time `db:"dateline"`
	Uname      string    `db:"uname"`
	AgtId      int64     `db:"agtid"`
	Agtuid     string    `db:"agtuid"`
	DeviceType int32     `db:"device"`
	DeviceInfo string    `db:"dinfo"`
}
